home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libexif / exif-data.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-13  |  3.9 KB  |  121 lines

  1. /*! \file exif-data.h
  2.  * \brief FIXME foo bar blah
  3.  *
  4.  * \author Lutz Mⁿller <lutz@users.sourceforge.net>
  5.  * \date 2001-2005
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful, 
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details. 
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22.  
  23. #ifndef __EXIF_DATA_H__
  24. #define __EXIF_DATA_H__
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif /* __cplusplus */
  29.  
  30. #include <libexif/exif-byte-order.h>
  31. #include <libexif/exif-data-type.h>
  32. #include <libexif/exif-ifd.h>
  33. #include <libexif/exif-log.h>
  34. #include <libexif/exif-tag.h>
  35.  
  36. typedef struct _ExifData        ExifData;
  37. typedef struct _ExifDataPrivate ExifDataPrivate;
  38.  
  39. #include <libexif/exif-content.h>
  40. #include <libexif/exif-mnote-data.h>
  41. #include <libexif/exif-mem.h>
  42.  
  43. struct _ExifData
  44. {
  45.     ExifContent *ifd[EXIF_IFD_COUNT];
  46.  
  47.     unsigned char *data;
  48.     unsigned int size;
  49.  
  50.     ExifDataPrivate *priv;
  51. };
  52.  
  53. ExifData *exif_data_new           (void);
  54. ExifData *exif_data_new_mem       (ExifMem *);
  55.  
  56. /*! \brief load exif data from file
  57.  *  \param[in] path filename including path
  58.  *  
  59.  *  Foo bar blah bleh baz.
  60.  */
  61. ExifData *exif_data_new_from_file (const char *path);
  62. ExifData *exif_data_new_from_data (const unsigned char *data,
  63.                    unsigned int size);
  64.  
  65. void      exif_data_load_data (ExifData *data, const unsigned char *d, 
  66.                    unsigned int size);
  67. void      exif_data_save_data (ExifData *data, unsigned char **d,
  68.                    unsigned int *size);
  69.  
  70. void      exif_data_ref   (ExifData *data);
  71. void      exif_data_unref (ExifData *data);
  72. void      exif_data_free  (ExifData *data);
  73.  
  74. ExifByteOrder exif_data_get_byte_order  (ExifData *data);
  75. void          exif_data_set_byte_order  (ExifData *data, ExifByteOrder order);
  76.  
  77. ExifMnoteData *exif_data_get_mnote_data (ExifData *);
  78. void           exif_data_fix (ExifData *);
  79.  
  80. typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
  81. void          exif_data_foreach_content (ExifData *data,
  82.                      ExifDataForeachContentFunc func,
  83.                      void *user_data);
  84.  
  85. typedef enum {
  86.     EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0,
  87.     EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1,
  88.     EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2
  89. } ExifDataOption;
  90.  
  91. const char *exif_data_option_get_name        (ExifDataOption);
  92. const char *exif_data_option_get_description (ExifDataOption);
  93. void        exif_data_set_option             (ExifData *, ExifDataOption);
  94. void        exif_data_unset_option           (ExifData *, ExifDataOption);
  95.  
  96. void         exif_data_set_data_type (ExifData *, ExifDataType);
  97. ExifDataType exif_data_get_data_type (ExifData *);
  98.  
  99. /* For debugging purposes and error reporting */
  100. void exif_data_dump (ExifData *data);
  101. void exif_data_log  (ExifData *data, ExifLog *log);
  102.  
  103. /* For your convenience */
  104. #define exif_data_get_entry(d,t)                    \
  105.     (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?            \
  106.      exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :            \
  107.      exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?            \
  108.      exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :            \
  109.      exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?        \
  110.      exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :        \
  111.      exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?        \
  112.      exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :        \
  113.      exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?    \
  114.      exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  115.  
  116. #ifdef __cplusplus
  117. }
  118. #endif /* __cplusplus */
  119.  
  120. #endif /* __EXIF_DATA_H__ */
  121.